package com.tju.backend.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * 【请填写功能名称】对象 t_warehousing
 *
 * @author xt-exhibition
 * @date 2021-05-19
 */
@Data
@NoArgsConstructor
public class TWarehousing {
    private static final long serialVersionUID = 1L;

    /**
     * $column.columnComment
     */
    @TableField(exist = false)
    private Long id;

    /**
     * 入仓编码
     */
    private String barCode;

    /**
     * 入仓大小
     */
    private String boxSize;

    private Integer oid;

    /**
     * 入仓时间
     */
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date warehousingTime;

    public TWarehousing(String barCode, String size, TStereoscopicWarehouse sw) {
        this.barCode = barCode;
        switch (size) {
            case "BIG":
                this.boxSize = "大箱子";
                break;
            case "MED":
                this.boxSize = "中箱子";
                break;
            case "SMA":
                this.boxSize = "小箱子";
                break;
        }
        this.oid=sw.getOid();
        this.warehousingTime = new Date();
    }

}
